package netTrackerGUI;


/**
 * A thread to handle cell outlining that is spawned
 * when a user tries to outline a cell. The thread
 * creates a CellOutliner object to handle the selection.
 * 
 * @author David Cummings
 * 
 */
public class CellOutlinerThread implements Runnable {
	CellOutliner myCellOutliner;
	
	/**
	 * Constructs a cell outliner to move a cell outline, given a direction to move.
	 * @param trackerPanel The tracker panel creating the thread.
	 * @param outlinedCell The cell to move the outline from.
	 * @param moveX the x amount to move. (positive is right)
	 * @param moveY the y amount to move. (positive is down)
	 * @param outlineID the ID of the node outlining the cell.
	 */
	public CellOutlinerThread(TrackerPanel trackerPanel, int moveX, int moveY, int outlineID){
		myCellOutliner = new CellOutliner(trackerPanel, moveX, moveY, outlineID);
	}
	/**
	 * Constructs a cell outliner to try to move to a given cell outline without a direction.
	 * @param trackerPanel The tracker panel creating the thread.
	 * @param targetCell The cell to move to.
	 * @param outlineID the ID of the node outlining the cell.
	 */
	public CellOutlinerThread(TrackerPanel trackerPanel, CellGUI targetCell, int outlineID){
		myCellOutliner = new CellOutliner(trackerPanel, targetCell, outlineID);
	}
	
	public void run() {
		myCellOutliner.attemptOutlineCell();
	}
}